/*

*/

#include <stdio.h>
#include <math.h>

// 判断是否为素数
int is_prim(int a)
{
    int prim = 1;
    int x = sqrt(a)+1;

    for(int i=2; i<x; i++){
        if(a%i==0){
            prim =0;
            break;
        }
    }
    return prim;
}

// 从中间开始寻找
int main()
{
    int number = 0;
    int start = 0;

    while (scanf("%d", &number) != EOF) {
        start = number / 2;
        for (int i = start; i >= 2; i--) {
            if (is_prim(i) && is_prim(number-i)) {
                printf("%d\n%d\n", i, number-i);
                break;
            }
        }
    }

    return 0;
}